#include "stdafx.h"
#include "RankManager.h"

RankManager::RankManager()
{
	m_nRankVersion = 0;
	SetAutoDestroy(false);
	m_nTimerUpdateRank = CreateTimer(boost::bind(&RankManager::onTimerUpdateRank, this,_1),30*60*1000,TimerManager::TIMER_INFINITE);

}
RankManager::~RankManager()
{

}
void RankManager::onTimerUpdateRank(UInt32 nTimerId)
{
	if(m_nTimerUpdateRank != nTimerId)
		LOGGER_ERROR("onTimerUpdateRank,m_nTimerUpdateRank:%d,nTimerId:%d",m_nTimerUpdateRank,nTimerId);
	GetRankFromDataServer();
}
void RankManager::GetRankFromDataServer()
{
	LOGGER_INFO("GetRankFromDataServer");

	PacketEncoder encoder;
	encoder.AddItem(Int32(0));
	encoder.AddItem(Int32(400));
	SendPacketToData(encoder);
}